<?php

class PersonController extends BaseController
{
	public function register()
	{
		$this->add();
	}
	
	public function add()
	{
		$model = PersonModel::getInstance();
		$data = array(
			"name" => 'whq',
			'sex' => '男',
			'hunger' => 50,
			'gain' => 0,
			'bodyTemperature' => 37,
			'wood' => 0, 
		);
		$model->register( $data );
		
		echo "注册成功";
	}
	
	public function showinfo()
	{
		$uid = intval( $_GET['uId'] );
		$model = PersonModel::getInstance( $uid );
		return $model->getInformation();
	}
	public function getForest()
	{
		$forest = ForestModel::getInstance( 1 );
		for ( $i = 0; $i < 10000; $i++ ) 
		{
			$forest->grow();	
		}
		echo $forest->getTreesNum();
	}
}
?>